package com.reins.bookstore.object;

import com.reins.bookstore.entity.Book;
import lombok.Data;

import java.math.BigDecimal;

/*
 * 返回用于热榜展示的一行所需要的数据
 */

@Data
public class HotListDTO {

    private int bookId;     // 书本id

    private Integer hot;    // 热度排名
    private String name;    // 书名
    private String author;  // 作者名字
    private BigDecimal price;   // 书本价格

    public HotListDTO(int bookId, Integer hot, String name, String author, BigDecimal price){
        this.bookId = bookId;
        this.name = name;
        this.author = author;
        this.price = price;
        this.hot = hot;
    }
    public HotListDTO(Book book, int hot){
        this.bookId = book.getBookId();
        this.name = book.getName();
        this.author = book.getAuthor();
        this.price = book.getPrice();
        this.hot = hot;
    }

    public HotListDTO() {
    }
}
